//============================================================================
// Name        : BestTry.cpp
// Author      : Marc Petroff
// Version     :
// Copyright   : MPRights (2014)
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <stdio.h>
#include <memory.h>
#include <cstdlib>
#include <iostream>

extern int mp_getVersion(char **);
extern int mp_getEncrypt(char *);
extern int mp_getGrog(char *);

using namespace std;

int main() {

	void *l[4];
	char **d;
	int u;

struct B {
	char **j;
	int z;
} b,e;


B *s;
d = (char **)calloc(2,sizeof(char));
d[0] = (char *)calloc(255,sizeof(char));
d[1] = (char *)calloc(255,sizeof(char));

/*if ((u = mp_getVersion(d[0]))) {
	std::cout << (char *)d[0] << std::endl;
}*/

//l = calloc(2,sizeof(char));
l[0] = calloc(255,sizeof(char));
l[1] = calloc(255,sizeof(char));
l[2] = calloc(255,sizeof(char));
l[3] = NULL;
strcpy((char *)l[0],"Somestuff");
strcpy((char *)l[1],"Unwantedcrap");

b.j = (char **)l;
e.j = (char **)l;
//setenv("LD_LIBRARY_PATH","/home/marc/workspace/BestTry/Release:$LD_LIBRARY_PATH",)

e.z = mp_getVersion(d);

//e.z = mp_getEncrypt("Dud");

strcpy(e.j[1],"Morecrap");
s->j = (char **)l;
strcpy((char *)l[2],"After insert");

	cout << "[GB_en]Hello World " << d[0] << " detailed version :" << d[1] << b.j[0] << " " << e.j[1] << " " << s->j[2] << endl; // prints [GB_en]Hello World
	return 0;
}
